import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Decoracion class
 * @author Hugo Armando Rodríguez Flores 
 * @version May 11th 2013
 */
public class Decoracion extends Actor
{
    /**
     * Detects when a knife has touched this piece of Decoracion
     */
    public void act()
    {
        this.knifeDetection();
    }
    
    /**
     * When a knife touches the current piece of Decoracion this removes it from the world.
     */
    public void knifeDetection()
    {
        Actor knife=this.getOneIntersectingObject(Cuchillo.class);
        World world=getWorld();
        if (knife!=null)
            world.removeObject(knife);
    }
}
